#!/bin/bash -e

docker rm -f tinyops-test-ssh-executor 2> /dev/null || true

# https://github.com/phusion/baseimage-docker#enabling-ssh
docker run -d \
    --name tinyops-test-ssh-executor \
    -p 2222:22 \
    -v "$PWD/tests/etc/ssh/20_enable_ssh.sh:/etc/my_init.d/20_enable_ssh.sh" \
    phusion/baseimage:0.11 \
    /sbin/my_init --enable-insecure-key

echo 'container tinyops-test-ssh-executor started'
sleep 3
docker ps | grep tinyops-test-ssh-executor
